//1.1导入http模块
const http = require('http')

//1.2创建web服务器实例
const server = http.createServer()

http.createServer((req,res)=>{
    //请求头
    res.writeHead(200,{'Content-Type':'text/html;charset=utf-8'})
    //req  接受浏览器传的参数
    //res 返回渲染的内容
    res.write(`
        <!DOCTYPE html>
        <html>
          <head>
            <meta charset="UTF-8">
            <title>我的网页</title>
          </head>
          <body>
            <b>我是加粗的</b>
            <div>
                我是div
            </div>
          </body>
        </html>
        `)
        res.end()
}).listen(80,()=>{
    console.log('Express server running at http://127.0.0.1')
})
